//
//  GoalKeeper.m
//  Soccer
//
//  Created by Hyun-Woong Kim on 09. 06. 03.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "GoalKeeper.h"


@implementation GoalKeeper

@synthesize goalPostBounds;

- (CGPoint)checkOutline:(CGPoint)pos
{	
	float minY = goalPostBounds.origin.y;
	float maxY = goalPostBounds.origin.y + goalPostBounds.size.height;
	if (pos.y < minY)
	{
		pos.y += minY - pos.y;
		dirRad = -dirRad;
	}
	else if (pos.y > maxY)
	{
		pos.y += maxY - pos.y;
		dirRad = -dirRad;
	}
	return pos;
}

@end
